const server = require("express")();
const auth = require("./auth/auth");
const bodyParser = require("body-parser");

//解析req.body数据的依赖
server.use(bodyParser.json({ limit: "1mb" }));
server.use(
  bodyParser.urlencoded({
    //此项必须在 bodyParser.json 下面,为参数编码
    extended: true,
  })
);

const mweb = require('./module/m-zxxk2.0');
const antdNuxtSpringMybatis = require('./module/antd-nuxt-springmvc-mybatis');
const adAdminWeb = require('./module/ad-admin-web');
const adTemplateEngin = require('./module/ad-template-engin');

server.post("/hooks/m-zxxk2-test", mweb);
server.post("/hooks/antd-nuxt-springmvc-mybatis-push", antdNuxtSpringMybatis);
server.post("/hooks/ad-admin-web", adAdminWeb);
server.post("/hooks/ad-template-engin", adTemplateEngin);

process.on('uncaughtException', function (err) {
  // 这里可以做写日志的操作
  console.log(err);
  // 退出进程
  // process.exit(1);
});


server.listen(4000);
console.log('开始监听4000端口...')
